import React from 'react';
import { Result, Button, Row, Col } from 'antd';
import { useNavigate } from 'react-router-dom';
import { HomeOutlined } from '@ant-design/icons';

const NotFoundPage: React.FC = () => {
  const navigate = useNavigate();

  const handleGoHome = () => {
    navigate('/home');
  };

  return (
    <Row justify="center" align="middle" style={{ minHeight: '50vh' }}>
      <Col>
        <Result
          status="404"
          title="404"
          subTitle="抱歉，您访问的页面不存在"
          extra={
            <Button type="primary" icon={<HomeOutlined />} onClick={handleGoHome}>
              返回首页
            </Button>
          }
        />
      </Col>
    </Row>
  );
};

export default NotFoundPage;